using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace  GameManager
{
    public class CircleLineComponent
    {
        public LineRenderer Circle;
        private float xradius;
        private float yradius;
        private int segments = 20;
        
        public void CreatePoints(LineRenderer Circle,float xradius,float yradius,int segments = 20) {
        
            float x;
            float y;
            //float z = WhiteBall.transform.position.y;
            float z = 0;

            float angle = 20f;

            for (int i = 0; i < (segments + 1); i++) {
                x = Mathf.Sin(Mathf.Deg2Rad * angle) * xradius;
                y = Mathf.Cos(Mathf.Deg2Rad * angle) * yradius;

                Circle.SetPosition(i, new Vector3(x, y, z));

                angle += (360f / segments);
            }
        }
    }
}

